package com.weishuang.monitor.employee.entity;

import com.weishuang.monitor.employee.commons.LocalDateTimeUtils;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 服务器内存实时信息
 * </p>
 *
 * @author weishuang
 * @since 2021-03-23
 */
public class ServerRamRealTime implements BaseEntity,Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 已使用
     */
    private Long total;

    /**
     * 剩余
     */
    private Long available;

    /**
     * 创建时间
     */
    private LocalDateTime createdTime;

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Long getAvailable() {
        return available;
    }

    public void setAvailable(Long available) {
        this.available = available;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    @Override
    public Map<String, Object> toMap() {
        Map<String, Object> map = new HashMap<>();
        map.put("total", total);
        map.put("available", available);
        map.put("createdTime", LocalDateTimeUtils.getUtcToShanghaiDate(createdTime));
        return map;
    }
}
